package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.dto.SetmealPageQueryDTO;
import com.sky.entity.Setmeal;
import com.sky.vo.SetmealVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealMapper {
    @Select("SELECT * FROM setmeal WHERE category_id = #{id}")
    List<Setmeal> selectByCategoryId(Long id);

    Page<SetmealVO> page(SetmealPageQueryDTO dto);

    void insert(Setmeal setmeal);

    void update(Setmeal setmeal);

    Setmeal selectById(Long id);

    void deleteByIds(String[] idArr);

    @Select("SELECT COUNT(*) FROM setmeal WHERE status = #{status}")
    Integer countByStatus(Integer status);

    @Select("select * from setmeal where category_id = #{categoryId}")
    List<Setmeal> list(Long categoryId);
}
